//
//  PKHeaderView.m
//  AMomentApp
//
//  Created by lanou on 15/10/6.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "PKHeaderView.h"

@implementation PKHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        _leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _leftButton.frame = CGRectMake(10, 15, 25, 25);
        [_leftButton setImage:[UIImage imageNamed:@"arrow"] forState:UIControlStateNormal];
        [self addSubview:_leftButton];
        
        _typeImageView = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-250, 15, 20, 20)];
        _typeImageView.image = [UIImage imageNamed:@"list"];
        [self addSubview:_typeImageView];
        
        _collectionButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _collectionButton.frame = CGRectMake(SCREEN_WIDTH-190, 15, 20, 20);
        [_collectionButton setImage:[UIImage imageNamed:@"collection"] forState:UIControlStateNormal];
        [self addSubview:_collectionButton];
        
        _shareButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _shareButton.frame = CGRectMake(SCREEN_WIDTH-130, 15, 20, 20);
        [_shareButton setImage:[UIImage imageNamed:@"share"] forState:UIControlStateNormal];
        [self addSubview:_shareButton];

        _timeButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _timeButton.frame = CGRectMake(SCREEN_WIDTH-70, 15, 20, 20);
        [_timeButton setImage:[UIImage imageNamed:@"time"] forState:UIControlStateNormal];
        [self addSubview:_timeButton];
        
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(45, 0, 1, self.bounds.size.height)];
        imageView.image = [UIImage imageNamed:@"essage"];
        [self addSubview:imageView];
        
        UIImageView *bottomImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, self.bounds.size.height-1, SCREEN_WIDTH, 1)];
        bottomImageView.backgroundColor = [UIColor colorWithWhite:0.667 alpha:0.210];
        bottomImageView.image = [UIImage imageNamed:@"line"];
        [self addSubview:bottomImageView];
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
